﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Create.ascx.vb" Inherits="Control_ImageAdver_Create" %>
<script type="text/javascript">

    function ajaxJquery() {
        $(function () {


            var root = $("#<%=txtRootImageUpload.ClientID()%>").val();


            //Upload Image
            $('#file_upload').uploadify({
                'uploader': '<%=ResolveUrl("~/uploadify/uploadify.swf")%>',
                'script': '<%=ResolveUrl("~/uploadify/Upload.ashx")%>',
                'cancelImg': '<%=ResolveUrl("~/uploadify/cancel.png")%>',
                'folder': '<%=ResolveUrl("~/Uploads")%>',
                'auto': false,
                'multi': false,
                'fileExt': '*.jpg;*.gif;*.png;*.jpeg;*.bmp',
                'fileDesc': 'Web Image Files (.JPG, .GIF, .PNG , .JPEG , .BMP)',
                'fileDataName': 'myfile',
                'sizeLimit': '<%= ConfigurationManager.AppSettings("maxupload") %>',
                'onComplete': function (event, ID, fileObj, response, data) {
                    $('#<%=hidImagePath.ClientID %>').val(root + response);
                    $('#<%=imgUpload.ClientID %>').attr("src", root + response);
                }
            });
        });
    }



</script>
<asp:UpdatePanel ID="uplImagesadver" runat="server">
    <ContentTemplate>
        <div class="content_porletform">
            <div class="DivRow">
                <h3>
                    TẠO IMAGESADVER
                </h3>
            </div>
            <div class="box_contentform">
                <div class="box_scroll_grid">
                    <div class="DivRequired">
                        <span class="fieldRequired">&nbsp;</span>Trường yêu cầu nhập dữ liệu
                    </div>
                    <div class="Error">
                        <asp:ValidationSummary ID="ValidationSummary2" runat="server" ForeColor="#FF3300" />
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblTitle_edit" runat="server" Text="Tiêu đề:"></asp:Label><span class="fieldRequired">&nbsp;</span>
                        </div>
                        <div>
                            <asp:TextBox ID="txtTitle" runat="server" CssClass="TextBox" Text=""></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitle"
                                ErrorMessage="Hãy nhập tiêu đề"></asp:RequiredFieldValidator></div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblDescription_edit" runat="server" Text="Mô tả:"></asp:Label>
                        </div>
                        <div>
                            <asp:TextBox ID="txtDescription" runat="server" CssClass="TextBox" Text="" TextMode="MultiLine"></asp:TextBox>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblImageurl" CssClass="TextLabel" runat="server" Text="Ảnh:" /><span
                                class="fieldRequired">&nbsp;</span>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="hidImagePath"
                                Display="None" ErrorMessage=" Vui lòng nhập ảnh"></asp:RequiredFieldValidator>
                        </div>
                        <div class="DivTextBox">
                            <input id="file_upload" name="file_upload" type="file" /><a id="upload" href="javascript:$('#file_upload').uploadifyUpload();">Upload
                                Files</a>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            &nbsp;</div>
                        <div style="height: 100px;" class="DivTextBox">
                            <asp:Image ID="imgUpload" runat="server" BorderWidth="0px" Height="100px" Width="100px"
                                ImageUrl="~/Images/NoPhotoAvailable.jpg" />
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label2" runat="server" Text="URL:"></asp:Label><span class="fieldRequired">&nbsp;</span>
                        </div>
                        <div>
                            <asp:TextBox ID="txtURL" runat="server" CssClass="TextBox" Text=""></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtURL"
                                ErrorMessage="Hãy nhập URL"></asp:RequiredFieldValidator></div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="Label1" runat="server" Text="Vị trí:"></asp:Label><span class="fieldRequired">&nbsp;</span>
                        </div>
                        <div>
                            <asp:TextBox ID="txtSort" runat="server" CssClass="TextBox" Text=""></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtSort"
                                ErrorMessage="Hãy nhập vị trí"></asp:RequiredFieldValidator>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtSort"
                                ErrorMessage="Hãy nhập vị trí từ 0 - 9999" MaximumValue="9999" MinimumValue="0"></asp:RangeValidator></div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            <asp:Label ID="lblSubject_edit" runat="server" Text="Loại:"></asp:Label>
                        </div>
                        <div>
                            <asp:DropDownList ID="ddlSubject" runat="server">
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="DivRow">
                        <div class="DivLabel">
                            &nbsp;&nbsp;&nbsp;</div>
                        <div class="DivTextBox">
                            <asp:Button ID="btnSave" runat="server" Text=" Lưu " CssClass="btn" />
                            <asp:Button ID="btnHuy" CausesValidation="false" runat="server" Text=" Hủy " CssClass="btn" />&nbsp;
                        </div>
                    </div>
                    <div style="display: none">
                        <asp:HiddenField ID="hidID" Value="0" runat="server" />
                        <asp:TextBox ID="txtRootImageUpload" runat="server" />
                        <asp:TextBox ID="hidImagePath" Text="" runat="server" />
                    </div>
                </div>
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
